<template>
    <div>
        <Top/>
      
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../css/jpetstore.css" type="text/css">
</head>
<body>
<div th:replace="common/top"/>
<div id="Content">

    <div id="Catalog">


        <form action="/account/update_info" method="post">

            <h3>User Information</h3>

            <table>
                <tr>
                    <td>User ID:</td>
                    <td th:text="${session.account.getUsername()}">{{account.username}}</td>
                </tr>
                <tr>
                    <td>New password:</td>
                    <td><input type="password" name="password">{{signon.password}}</td>
                </tr>
                <tr>
                    <td>Repeat password:</td>
                    <td><input type="password" name="repeatedPassword"/></td>
                </tr>
            </table>

            <h3>Account Information</h3>

            <table>
                <tr>
                    <td>First name:</td>
                    <td><input type="text" name="firstName" />{{this.account.firstName}}</td>
                </tr>
                <tr>
                    <td>Last name:</td>
                    <td><input type="text" name="lastName" th:value="${session.account.getLastName()}"/>{{account.lastName}}</td>
                </tr>
                <tr>
                    <td>Email:</td>
                    <td><input type="text" name="email" th:value="${session.account.getEmail()}"/>{{account.email}}</td>
                </tr>
                <tr>
                    <td>Phone:</td>
                    <td><input type="text" name="phone" th:value="${session.account.getPhone()}"/>{{account.phone}}</td>
                </tr>
                <tr>
                    <td>Address 1:</td>
                    <td><input type="text" name="address1" th:value="${session.account.getAddress1()}"/>{{account.address1}}</td>
                </tr>
                <tr>
                    <td>Address 2:</td>
                    <td><input type="text" name="address2" size="40" th:value="${session.account.getAddress2()}"/>{{account.address2}}</td>
                </tr>
                <tr>
                    <td>City:</td>
                    <td><input type="text" name="city" th:value="${session.account.getCity()}"/>{{account.city}}</td>
                </tr>
                <tr>
                    <td>State:</td>
                    <td><input type="text" name="state" size="4" th:value="${session.account.getState()}"/>{{account.state}}</td>
                </tr>
                <tr>
                    <td>Zip:</td>
                    <td><input type="text" name="zip" size="10" th:value="${session.account.getZip()}"/>{{account.Zip}}</td>
                </tr>
                <tr>
                    <td>Country:</td>
                    <td><input type="text" name="country" size="15" th:value="${session.account.getCountry()}"/>{{account.country}}</td>
                </tr>
            </table>

            <h3>Profile Information</h3>

            <table>
                <tr>
                    <td>Language Preference:</td>
                    <td>
                        <select name="languagePreference">
                            <option th:each="language:${languageList}" th:text="${language}"
                                    th:value="${language}"></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Favourite Category:</td>
                    <td></td><select name="favouriteCategoryId">
                        <option th:each="category:${categoryList}" th:text="${category}"
                                th:value="${category}"></option>
                    </select>
                </tr>
                <tr>
                    <td>Enable MyList</td>
                    <td><input type="checkbox" name="listOption" value="1"/></td>
                </tr>
                <tr>
                    <td>Enable MyBanner</td>
                    <td><input type="checkbox" name="bannerOption" value="1"/></td>
                </tr>

            </table>

            <input value="Save Account Information"
                   type="submit">

        </form>

<!--        th:href="@{'/catalog/viewProduct'(productId=${product.productId})}-->
        <a th:href="@{'/order/viewOrderList'(username=${session.username})}">My Orders</a>


    </div>

</div>

<div th:replace="common/bottom"/>
</body>
</html>
        <Bottom/>
    </div>
</template>
<script>
import Top from '../../common/top'
import Bottom from '../../common/bottom'
console.log("we0fjqepfjqefpqwj")
export default {
    setup() {
        
    },
    data () {
        return {
            account : [],
            signon : []
        }
    },
    components: {
         Bottom,
        Top
       
    },
     created () {
        console.log("高考加油")
        const _this = this
        //这句话将route中的参数传递到category中
         const url = this.$route.params.uid
         
         console.log(url)
        axios.get("http://localhost:8081/account/"+url).then(function(resp){
              console.log(resp)
              _this.account = resp.data.data
          })  
          axios.get("http://localhost:8081/account/signon/"+url).then(function(resp1){
              console.log(resp1)
              _this.signon = resp1.data.data
          })
    },
}
</script>
<style scoped>

</style>